package com.netease.pris.activity;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import android.widget.Toast;
import com.netease.framework.ActivityEx;
import com.netease.image.c;
import com.netease.l.b.d;
import com.netease.pris.a.e;
import com.netease.pris.b;
import com.netease.pris.b.a;
import com.netease.pris.v;

public class LoginActivity extends ActivityEx
{
  public static final int a = 0;
  public static final int b = 1;
  public static final int c = 0;
  public static final int d = 1;
  public static final String e = "user";
  public static final String f = "from";
  static final int g = 5;
  static final int h = 10;
  static final int i = 16;
  private static final String p = "state";
  private LinearLayout A;
  private TextView B = null;
  private ImageView C;
  private ImageView D;
  private TextView E;
  private TextView F;
  TextWatcher j = new r(this);
  TextWatcher k = new t(this);
  View.OnFocusChangeListener l = new g(this);
  View.OnFocusChangeListener m = new h(this);
  View.OnClickListener n = new i(this);
  b o = new k(this);
  private boolean q = false;
  private int r = 0;
  private int s = 0;
  private int t = 0;
  private int u = 0;
  private Context v = null;
  private EditText w = null;
  private EditText x = null;
  private Button y = null;
  private int z;

  private void a(int paramInt)
  {
    this.t = paramInt;
    if (this.t == 0)
    {
      k();
      this.A.setVisibility(0);
    }
    while (true)
    {
      return;
      if (1 == this.t)
      {
        l();
        this.A.setVisibility(8);
        continue;
      }
    }
  }

  public static void a(Context paramContext, int paramInt1, int paramInt2)
  {
    Intent localIntent = new Intent(paramContext, LoginActivity.class);
    localIntent.putExtra("state", paramInt1);
    localIntent.putExtra("from", paramInt2);
    paramContext.startActivity(localIntent);
  }

  private boolean a(String paramString)
  {
    int i1 = 0;
    if (TextUtils.isEmpty(paramString));
    while (true)
    {
      return i1;
      if ((!e.d(paramString)) && (!e.e(paramString)))
        continue;
      i1 = 1;
    }
  }

  private void b()
  {
    a(new LinearLayout.LayoutParams(-2, c.a(this.v, 48.0F)));
    a(null);
    d(2130837688);
  }

  private void b(int paramInt)
  {
    d.b(this.v, 256);
    if (this.z == 0)
      MainGridActivity.a(this, 1, true, 0);
    finish();
  }

  private void c()
  {
    this.w = ((EditText)findViewById(2131558556));
    this.x = ((EditText)findViewById(2131558558));
    this.y = ((Button)findViewById(2131558563));
    this.A = ((LinearLayout)findViewById(2131558554));
    this.C = ((ImageView)findViewById(2131558557));
    this.D = ((ImageView)findViewById(2131558559));
    this.B = ((TextView)findViewById(2131558562));
    this.E = ((TextView)findViewById(2131558560));
    this.F = ((TextView)findViewById(2131558561));
  }

  private boolean c(String paramString)
  {
    if (TextUtils.isEmpty(paramString));
    for (int i1 = 0; ; i1 = 1)
      return i1;
  }

  private void e()
  {
    if (this.w != null)
    {
      this.w.addTextChangedListener(this.j);
      this.w.setOnFocusChangeListener(this.l);
    }
    if (this.x != null)
    {
      this.x.addTextChangedListener(this.k);
      this.x.setOnFocusChangeListener(this.m);
    }
    if (this.y != null)
      this.y.setOnClickListener(this.n);
    if (this.C != null)
      this.C.setOnClickListener(this.n);
    if (this.D != null)
      this.D.setOnClickListener(this.n);
    if (this.E != null)
      this.E.setOnClickListener(this.n);
    if (this.F != null)
      this.F.setOnClickListener(this.n);
  }

  private void f()
  {
    if ((this.w.length() <= 0) || (this.x.length() <= 0))
      Toast.makeText(this, "Input Name or Password", 1).show();
    while (true)
    {
      return;
      String str1 = this.w.getEditableText().toString();
      String str2 = this.x.getEditableText().toString();
      this.r = v.a().a(str1, str2, this.z);
    }
  }

  private void g()
  {
    PRISAboutActivity.a(this);
  }

  public void a(View paramView)
  {
    if (this.w == null);
    while (true)
    {
      return;
      this.w.setText("");
    }
  }

  public void b(View paramView)
  {
    if (this.x == null);
    while (true)
    {
      return;
      this.x.setText("");
    }
  }

  public void c(View paramView)
  {
    if (!(paramView instanceof TextView));
    while (true)
    {
      return;
      if (this.A != null)
      {
        startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://reg.163.com/getpasswd/RetakePassword.jsp")));
        continue;
      }
    }
  }

  public void d(View paramView)
  {
    if (!(paramView instanceof TextView));
    while (true)
    {
      return;
      if (this.A != null)
      {
        startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://reg.163.com/reg/reg.jsp?product=urs")));
        continue;
      }
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903088);
    this.u = 0;
    this.v = this;
    Intent localIntent = getIntent();
    if (localIntent != null)
    {
      this.s = localIntent.getIntExtra("state", 0);
      this.z = localIntent.getIntExtra("from", 0);
    }
    v.a().a(this.o);
    c();
    e();
    this.q = true;
    if ((a.c() != null) && (a.g() != null))
      this.q = false;
    if ((this.q) && (this.y != null))
    {
      this.y.setClickable(false);
      this.y.setEnabled(false);
    }
    if (this.s == 0)
    {
      if (this.w != null)
        this.w.setText(a.c());
      if (this.x != null)
        this.x.setText(a.g());
    }
    label246: 
    while (true)
    {
      b();
      a(0);
      if (this.z == 6)
        this.B.setVisibility(0);
      while (true)
      {
        return;
        if (1 != this.s)
          break label246;
        if (this.w != null)
          this.w.setText("");
        if (this.x == null)
          break;
        this.x.setText("");
        break;
        this.B.setVisibility(8);
      }
    }
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    getMenuInflater().inflate(2131492866, paramMenu);
    return super.onCreateOptionsMenu(paramMenu);
  }

  public void onDestroy()
  {
    super.onDestroy();
    v.a().b(this.o);
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    int i1 = 1;
    if ((4 == paramInt) && (i1 == this.t))
      a(0);
    while (true)
    {
      if (i1 != 0);
      while (true)
      {
        return i1;
        bool = super.onKeyDown(paramInt, paramKeyEvent);
      }
      boolean bool = false;
    }
  }

  protected void onNewIntent(Intent paramIntent)
  {
    super.onNewIntent(paramIntent);
    String str = paramIntent.getAction();
    if (str == null);
    while (true)
    {
      return;
      if (str.equals("user"))
        continue;
    }
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    switch (paramMenuItem.getItemId())
    {
    default:
    case 2131558723:
    }
    while (true)
    {
      return super.onOptionsItemSelected(paramMenuItem);
      g();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.LoginActivity
 * JD-Core Version:    0.6.0
 */